<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/static/bootstrap-3.3.7-dist/css/bootstrap.min.css">
</head>
<body>

<h1>查看书籍</h1>

<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
                <a href="/add_book/" class="btn btn-primary">添加书籍</a>
                <table class="table table-striped table-hover">
                <thead>
                <tr>
                    <th>编号</th>
                    <th>书籍名称</th>
                    <th>价格</th>
                    <th>出版日期</th>
                    <th>出版社</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {% for book in all_books %}

                    <tr>

                        <td>{{ forloop.counter }}</td>
                        <td>{{ book.title }}</td>
                        <td>{{ book.price }}</td>
                        <td>{{ book.publish_date|date:'Y-m-d' }}</td>
                        <td>{{ book.publish }}</td>
                        <td>
                            <a href="{% url 'edit_book' book.pk %}" class="btn btn-warning">编辑</a>
                            <a href="{% url 'delete_book' book.pk %}" class="btn btn-danger">删除</a>
{#                            /delete_book/3/#}
                        </td>
                    </tr>

                {% endfor %}

                </tbody>

            </table>


        </div>

    </div>



</div>






</body>
</html>